import java.util.Arrays;
import java.util.Scanner;

public class Main0 {
    public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int[] arr=new int[n];
    for (int i=0;i< arr.length;i++){
        arr[i]=sc.nextInt();
    }
    int m=0;
    for (int i=0;i<arr.length;i++){
        if (arr[i]>m){
            m=arr[i];//找出数组中最大值
        }
    }
    if (m%2==0){
        for (int i=0;i< arr.length;i++){
            if (arr[i]==m){
                int a=arr[i];
                arr[i]=a*2;
                }
            }
        }
    else for (int j=0;j< arr.length;j++){
        if (arr[j]==m){
            int b=arr[j];
            arr[j]=b+1;
            }
        }
    for (int i=0;i<n;i++){
        if (m%2==0){
            System.out.println(arr[i]+" ");
        }else System.out.println(arr[i]+" ");
    }
    }
}
